<template>
	<div id="">
		<van-row id="contents">
			<van-col span="1" @click="goback">
				<van-icon name="arrow-left" size="20" />
			</van-col>
			<van-col span="4" offset="9">
				{{name}}
			</van-col>
		</van-row>
		<div id="" style="width: 100vw;display: flex;flex-direction: row;flex-wrap: wrap;text-align: left;">
			<div id="" style="width: 45vw;margin-left: 3vw;height: 30vh;" v-for="item in list"
				@click="$router.push({path:'/details',query:{goods_id:item.goods_id}})">
				<div id="">
					<img v-lazy="url+item.original_img" style="width: 100%;height: 20vh;">
				</div>
				<div id="wen">
					{{item.goods_name}}
				</div>
				<div id="" style="color: red;font-size: 0.4rem;"><span
						style="font-size: 0.1rem;">￥</span>{{item.market_price}}</div>
			</div>
		</div>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				url: '',
				name: this.$route.query.name
			}
		},
		created() {
			let id = this.$route.query.id
			this.$store.dispatch('user/vuexNavfl', id)
				.then(e => {
					this.list = e.data.data
					console.log(e)
				})
			this.$store.dispatch('user/vuexUrl', '地址')
				.then(e => {
					this.url = e
					console.log(e)
				})
		},
		methods: {
			goback() {
				this.$router.go(-1)
			}
		}
	}
</script>

<style>
</style>
